<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="/template/template_dialog.xhtml">
	<ui:define name="head">
		<title>跳闸异常</title>
		<style>
</style>
	</ui:define>
	<ui:define name="content">
		<p:panelGrid style="width:100% !important;text-align:center">
			<f:facet name="header">
				<p:row>
				<p:column>
				<h:outputText value="#{tripException.lineName}跳闸异常" style="font-size:18px;" />
				<p:commandButton icon="fa fa-chevron-circle-left" style="float:left;"
					rendered="#{request.getParameter('showBackBtn')}" value="返回" onclick="back();"/>
				</p:column>
				</p:row>
			</f:facet>
		</p:panelGrid>
		<p:panelGrid style="width:100% !important;text-align:center">
			<p:row>
				<p:column style="width:120px;">
					<h:outputLabel value="分析结果:" />
				</p:column>
				<p:column colspan="4">
					<pre align="left"><p:outputLabel value="#{tripException.check.analyseResult}" rows="5"
						style="width:100%" /></pre>
				</p:column>
			</p:row>
		</p:panelGrid>
		<p:panelGrid style="width:100% !important;margin-top:10px">  
		    <f:facet name="header">
				<p:row>
				   <p:column colspan="5">
				     <h:outputText value="检查情况" style="font-size:16px;float:left" />
				  </p:column>
				</p:row>
				<p:row>
				   <p:column style="width:12%">
						<h:outputText value="检查人员" />
					</p:column>
				   <p:column style="width:50%">
						<h:outputText value="检查结果" />
					</p:column>
				   <p:column style="width:10%">
						<h:outputText value="检查时间" />
					</p:column>
				   <p:column style="width:8%">
						<h:outputText value="是否确认" />
					</p:column>
					<p:column style="width:25%">
						<h:outputText value="附件" />
					</p:column>
				</p:row>
			</f:facet>
			<p:row rendered="#{tripException.check!=null}" style="text-align:center">
			   <p:column>
					<h:outputText value="#{tripException.check.checker}"/>
				</p:column>
			   <p:column>
					<h:outputText value="#{tripException.check.checkResult}"/>
				</p:column>
			   <p:column>
					<h:outputText value="#{tripException.check.checkTime}">
					     <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss"></f:convertDateTime>
					</h:outputText>
				</p:column>
			   <p:column>
					<h:outputText value="#{tripException.check.isChecked== true?'是':'否'}"/>
				</p:column>
				<p:column style="text-align:left">
					<p:rowExpansion>
						<p:repeat value="#{tripException.attachments}" var="file" >
							<div class="row" style="padding-left: 10px;">
								<span>#{file.description}</span>
							</div>
						</p:repeat>
					</p:rowExpansion>
				</p:column>
			</p:row>
			<p:row rendered="#{tripException.check==null}">
			   <p:column colspan="4">
					<h:outputText value="暂无检查信息" />
				</p:column>
			</p:row>
		</p:panelGrid> 
		<p:panelGrid style="width:100% !important;text-align:center;margin-top:10px">
		  <f:facet name="header">
				<p:row>
				   <p:column colspan="4">
				     <h:outputText value="详细信息" style="font-size:16px;float:left" />
				  </p:column>
				</p:row>
				<p:row>
				   <p:column>
						<h:outputText value="线路" />
					</p:column>
				   <p:column>
						<h:outputText value="厂站1" />
					</p:column>
				   <p:column>
						<h:outputText value="厂站2" />
					</p:column>
				   <p:column>
						<h:outputText value="电压等级" />
					</p:column>
				</p:row>
			</f:facet>
			<p:row style="text-align:center">
			   <p:column>
					<h:outputText value="#{tripException.lineName}"/>
				</p:column>
			   <p:column>
					<h:outputText value="#{tripException.station1}"/>
				</p:column>
			   <p:column>
					<h:outputText value="#{tripException.station2}"/>
				</p:column>
			   <p:column>
					<h:outputText value="#{tripException.voltage}"/>
				</p:column>
			</p:row>
		</p:panelGrid>
			
		<p:dataTable emptyMessage="无记录" rows="20"
			paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
			rowsPerPageTemplate="20,30,50" paginatorPosition="bottom"
			paginator="true" 
			value="#{tripException.trippingList}" var="item">
			<f:facet name="header">
                跳闸详情
           </f:facet>
			<p:column headerText="开关">
									#{item.switchName}
								</p:column>
			<p:column headerText="分闸时间">
				<h:outputText value="#{item.tripTime}">
					<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss"></f:convertDateTime>
				</h:outputText>
			</p:column>
		</p:dataTable>

		<h:inputHidden id="oId" value="#{request.getParameter('oId')}" />
	</ui:define>
	<ui:define name="contentend">
		<script>
			function back(){
				if(parent &amp;&amp; parent.backFromChild){
					parent.backFromChild();
				}else{
					window.history.back();
				}
			}
		</script>
	</ui:define>
</ui:composition>